extends Area2D

signal hited
@onready var texture: Sprite2D = $Texture

# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	if $Animation.is_playing():
		beat()

# 碰撞时发生的事件---武器击中敌人
func beat():
	var reach = get_overlapping_bodies()
	for i in reach:
		if i.is_in_group("enemy"):
			hited.emit()
			i.queue_free()

